package com.cy.pj.category.service.impl;

import com.cy.pj.category.dao.CategoryDao;
import com.cy.pj.category.pojo.Category;
import com.cy.pj.category.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryDao categoryDao;

    //查询业务
    @Override
    public List<Category> findCategory() {
        List<Category> list=categoryDao.findCategory();
        return list;
    }

    //删除业务
    @Override
    public int deleteCategory(Integer id) {
        int rows=categoryDao.deleteCategory(id);
        return rows;
    }

    //新增数据
    @Override
    public int insetCategory(Category entity) {
        int rows=categoryDao.insetCategory(entity);
        return rows;
    }


}
